﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Register.DAL;
using Register.BLL;
using Register.Model;
using System.Web.Script.Serialization;

namespace RegisterWeb.Manager.RegistrationFeeManager.ashx
{
    /// <summary>
    /// DepartmentsService 的摘要说明
    /// </summary>
    public class DepartmentsService : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            String where = "Hospital_ID='";
            String id = "HP003";//暂时写死，以后SESSION
            where = where + id + "'";
         int count= DepartmentsBLL.GetDepartmentsCount(where);
     List<DepartmentsInfo>  list =  DepartmentsBLL.GetPagedDepartmentsInfo(count, 1, where);

     JavaScriptSerializer jss = new JavaScriptSerializer();
     context.Response.Write(jss.Serialize(list));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}